<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <script src="html5plus://ready"></script>
    <link rel="stylesheet" href="libs/css/index.css" />
    <script type="text/javascript" src="libs/js/vue.min.js" ></script>
    <script type="text/javascript" src="libs/js/vant.min.js" ></script>
	<script type="text/javascript" src="libs/js/exit.js" ></script>
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title></title>
    <!--<script type="text/javascript">
   		document.addEventListener('plusready', function(){
   			//console.log("所有plus api都应该在此事件发生后调用，否则会出现plus is undefined。"
   		});
    </script>-->
</head>
	<body>
		<div id="app">
			<van-tabbar v-model="active" v-show="isShow" @change="tabChange">
			    <van-tabbar-item icon="shop-o">首页</van-tabbar-item>
			    <van-tabbar-item icon="apps-o">分类</van-tabbar-item>
			    <van-tabbar-item icon="shopping-cart-o">购物车</van-tabbar-item>
			    <van-tabbar-item icon="manager-o">个人中心</van-tabbar-item>
			</van-tabbar>
		</div>
		<script type="text/javascript">
			var vm=new Vue({
				el:"#app",
				data:{
					active:0,
					isShow:true,
					Views:[
						{
							id:1,name:"home",url:"views/home-views/home.html"
						},
						{
							id:2,name:"assortment",url:"views/assortment-views/assortment.html"
						},
						{
							id:3,name:"cart",url:"views/cart-views/cart.html"
						},
						{
							id:4,name:"personal",url:"views/personal-views/personal.html"
						}
					],
				},
				methods:{
					tabChange:function(){
						plus.webview.show(this.Views[this.active].name);
					}
				},
				mounted:function(){
					var _this=this;
					document.addEventListener("plusready",function(){
						var rootWV=plus.webview.currentWebview();
						for(var i=0;i<_this.Views.length;i++){
							var tempWebview=plus.webview.create(_this.Views[i].url,_this.Views[i].name,{
								top:"0px",
								bottom:"50px",
								zindex:1,
								scrollIndicator:'none'
							})
							rootWV.append(tempWebview);
						}
						plus.webview.show(_this.Views[0].name);
					}),
					window.addEventListener("resize",function(){	
					})
					
				}
			})
		</script>
	</body>
</html>